home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX"
- Object = "{6E3BBBCF-5A0D-11D1-B659-0060976C699F}#1.1#0"; "MSysInfo.ocx"
- Begin VB.Form Form1
- BorderStyle = 3 'Fixed Dialog
- Caption = "MSysInfo Sample Tech Support Form"
- ClientHeight = 4875
- ClientLeft = 1260
- ClientTop = 1620
- ClientWidth = 9360
- Icon = "tech5.frx":0000
- LinkTopic = "Form1"
- LockControls = -1 'True
- MaxButton = 0 'False
- MinButton = 0 'False
- PaletteMode = 1 'UseZOrder
- ScaleHeight = 4875
- ScaleWidth = 9360
- ShowInTaskbar = 0 'False
- StartUpPosition = 2 'CenterScreen
- Begin VB.CommandButton cmdPrint
- Caption = "&Print"
- Height = 375
- Left = 7800
- TabIndex = 4
- Top = 4080
- Width = 1455
- End
- Begin VB.CommandButton cmdClose
- Caption = "&Close"
- Height = 375
- Left = 7800
- TabIndex = 0
- Top = 3600
- Width = 1455
- End
- Begin TabDlg.SSTab SSTab1
- Height = 3375
- Left = 120
- TabIndex = 1
- Top = 120
- Width = 9135
- _ExtentX = 16113
- _ExtentY = 5953
- _Version = 393216
- Style = 1
- Tabs = 4
- TabsPerRow = 4
- TabHeight = 520
- TabCaption(0) = "&Environment"
- TabPicture(0) = "tech5.frx":030A
- Tab(0).ControlEnabled= -1 'True
- Tab(0).Control(0)= "Text1(0)"
- Tab(0).Control(0).Enabled= 0 'False
- Tab(0).ControlCount= 1
- TabCaption(1) = "&Memory"
- TabPicture(1) = "tech5.frx":0326
- Tab(1).ControlEnabled= 0 'False
- Tab(1).Control(0)= "Text1(1)"
- Tab(1).ControlCount= 1
- TabCaption(2) = "&Drives"
- TabPicture(2) = "tech5.frx":0342
- Tab(2).ControlEnabled= 0 'False
- Tab(2).Control(0)= "Drive1"
- Tab(2).Control(1)= "Text1(2)"
- Tab(2).ControlCount= 2
- TabCaption(3) = "&Files"
- TabPicture(3) = "tech5.frx":035E
- Tab(3).ControlEnabled= 0 'False
- Tab(3).Control(0)= "Text1(3)"
- Tab(3).ControlCount= 1
- Begin VB.TextBox Text1
- BeginProperty Font
- Name = "Courier"
- Size = 9.75
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 2775
- Index = 3
- Left = -74880
- Locked = -1 'True
- MultiLine = -1 'True
- ScrollBars = 3 'Both
- TabIndex = 8
- Top = 480
- Width = 8895
- End
- Begin VB.TextBox Text1
- BeginProperty Font
- Name = "Courier"
- Size = 9.75
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 2775
- Index = 0
- Left = 120
- Locked = -1 'True
- MultiLine = -1 'True
- ScrollBars = 3 'Both
- TabIndex = 7
- Top = 480
- Width = 8895
- End
- Begin VB.TextBox Text1
- BeginProperty Font
- Name = "Courier"
- Size = 9.75
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 2775
- Index = 1
- Left = -74880
- Locked = -1 'True
- MultiLine = -1 'True
- ScrollBars = 3 'Both
- TabIndex = 6
- Top = 480
- Width = 8895
- End
- Begin VB.TextBox Text1
- BeginProperty Font
- Name = "Courier"
- Size = 9.75
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 2775
- Index = 2
- Left = -74880
- Locked = -1 'True
- MultiLine = -1 'True
- ScrollBars = 3 'Both
- TabIndex = 3
- Top = 480
- Width = 8895
- End
- Begin VB.DriveListBox Drive1
- Height = 315
- Left = -68880
- TabIndex = 2
- Top = 360
- Visible = 0 'False
- Width = 1575
- End
- End
- Begin SystemInfoControl.MSysInfo MSysInfo1
- Left = 7800
- Top = 4320
- _ExtentX = 847
- _ExtentY = 847
- End
- Begin VB.Label Label9
- Caption = "Label9"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 9.75
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 975
- Left = 240
- TabIndex = 5
- Top = 3720
- Width = 7335
- End
- Attribute VB_Name = "Form1"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Private Type m_DriveInfo
- Name As String
- Total As String
- Available As String
- Type As String
- End Type
- Private Sub cmdClose_Click()
- Unload Me
- End Sub
- Private Sub cmdPrint_Click()
- MousePointer = 11
- Printer.ScaleMode = vbTwips
- Printer.CurrentY = 1440
- Printer.Print "ENVIRONMENT:"
- Printer.Print Text1(0).Text & vbCrLf
- Printer.Print "MEMORY:"
- Printer.Print Text1(1).Text & vbCrLf
- Printer.Print "DRIVES:"
- Printer.Print Text1(2).Text & vbCrLf
- Printer.Print "FILES:"
- Printer.Print Text1(3).Text
- Printer.EndDoc
- MousePointer = 0
- End Sub
- Private Sub Form_Load()
- Dim lpTemp As String
- Dim l As Long 'temp variable for our loops
- Dim strHeader As String 'temp string to create a header for our results
- Dim aStr() As m_DriveInfo 'our custom array
- Dim mystr As String 'temp string
- Dim iTotalLen As Integer 'holds the longest value so we can format the results properly
- Dim iAvailableLen As Integer 'holds the longest value so we can format the results properly
- mystr = "This sample project demonstrates how one might use the Mabry SysInfo control " & _
- "to create a custom Form for providing information about the system on which an " & _
- "application is running. A printout of such information could be used by technical support " & _
- "staff in troubleshooting customer problems."
- Label9.Caption = mystr
- lpTemp = Me.Caption
- Me.Show
- cmdPrint.Enabled = False
- DoEvents
- MousePointer = 11
- 'ENVIRONMENT
- Me.Caption = "Getting environment info..."
- Text1(0).Text = Format$("Computer Name: ", "@@@@@@@@@@@@@@@@@@@@@@") & Trim$(MSysInfo1.ComputerName) & vbCrLf
- Text1(0).Text = Text1(0).Text & Format$("User Name: ", "@@@@@@@@@@@@@@@@@@@@@@") & Trim$(MSysInfo1.UserName) & vbCrLf & vbCrLf
- Text1(0).Text = Text1(0).Text & Format$("Windows Path: ", "@@@@@@@@@@@@@@@@@@@@@@") & MSysInfo1.WindowsPath & vbCrLf
- Text1(0).Text = Text1(0).Text & Format$("System Path: ", "@@@@@@@@@@@@@@@@@@@@@@") & MSysInfo1.SystemPath & vbCrLf
- Text1(0).Text = Text1(0).Text & Format$("Temp Path: ", "@@@@@@@@@@@@@@@@@@@@@@") & MSysInfo1.TempPath & vbCrLf & vbCrLf
- Text1(0).Text = Text1(0).Text & Format$("Number of Processors: ", "@@@@@@@@@@@@@@@@@@@@@@") & CStr(MSysInfo1.ProcessorCount) & vbCrLf
- l = MSysInfo1.ProcessorType
- Select Case l
- Case sysPROCESSOR_INTEL_386
- mystr = "Intel 386"
- Case sysPROCESSOR_INTEL_486
- mystr = "Intel 486"
- Case sysPROCESSOR_INTEL_PENTIUM
- mystr = "Intel Pentium"
- End Select
- Text1(0).Text = Text1(0).Text & Format$("Type of Processor: ", "@@@@@@@@@@@@@@@@@@@@@@") & mystr & vbCrLf & vbCrLf
- l = MSysInfo1.OSPlatform
- Select Case l
- Case sysPLATFORM_95
- If MSysInfo1.OSVersionMinor > 9 Then
- mystr = "Windows 98 "
- Else
- mystr = "Windows 95 "
- End If
- Case sysPLATFORM_NT
- mystr = "Windows NT "
- End Select
- mystr = mystr & MSysInfo1.OSVersionMajor & "." & MSysInfo1.OSVersionMinor & " Build " & MSysInfo1.OSBuild & " " & MSysInfo1.OSBuildOptions
- Text1(0).Text = Text1(0).Text & Format$("Operating System: ", "@@@@@@@@@@@@@@@@@@@@@@") & mystr
- 'MEMORY
- 'get the memory resources and format it so it will
- 'be easy to print
- Me.Caption = "Getting memory info..."
- Text1(1).Text = vbCrLf & Format$("Total Physical:", "@@@@@@@@@@@@@@@@@@@@@")
- Text1(1).Text = Text1(1).Text & " " & Format$(Format$(MSysInfo1.TotalPhysical, "#,###,###,##0"), "@@@@@@@@@@@@@") & " Bytes" & vbCrLf
- Text1(1).Text = Text1(1).Text & " " & Format$("Available Physical:", "@@@@@@@@@@@@@@@@@@@@")
- Text1(1).Text = Text1(1).Text & " " & Format$(Format$(MSysInfo1.AvailablePhysical, "#,###,###,##0"), "@@@@@@@@@@@@@") & " Bytes" & vbCrLf & vbCrLf
- Text1(1).Text = Text1(1).Text & " " & Format$("Total Virtual:", "@@@@@@@@@@@@@@@@@@@@")
- Text1(1).Text = Text1(1).Text & " " & Format$(Format$(MSysInfo1.TotalVirtual, "#,###,###,##0"), "@@@@@@@@@@@@@") & " Bytes" & vbCrLf
- Text1(1).Text = Text1(1).Text & " " & Format$("Available Virtual:", "@@@@@@@@@@@@@@@@@@@@")
- Text1(1).Text = Text1(1).Text & " " & Format$(Format$(MSysInfo1.AvailableVirtual, "#,###,###,##0"), "@@@@@@@@@@@@@") & " Bytes" & vbCrLf & vbCrLf
- Text1(1).Text = Text1(1).Text & " " & Format$("Total Page File:", "@@@@@@@@@@@@@@@@@@@@")
- Text1(1).Text = Text1(1).Text & " " & Format$(Format$(MSysInfo1.TotalPage, "#,###,###,##0"), "@@@@@@@@@@@@@") & " Bytes" & vbCrLf
- Text1(1).Text = Text1(1).Text & " " & Format$("Available Page File:", "@@@@@@@@@@@@@@@@@@@@")
- Text1(1).Text = Text1(1).Text & " " & Format$(Format$(MSysInfo1.AvailablePage, "#,###,###,##0"), "@@@@@@@@@@@@@") & " Bytes" & vbCrLf & vbCrLf
-
- 'DRIVES
- 'this code loops through all of the
- 'drives to get the desired drive info,
- 'such as total space, free space, and drive type
- 'and then loads an array with the info
- '
- 'after this code, we will loop through the array
- 'and format the data before displaying it
- Me.Caption = "Getting drive info..."
- ReDim aStr(Drive1.ListCount - 1) As m_DriveInfo 're-dimension the array to the correct size
- 'load the array with the info for each drive
- For l = 0 To Drive1.ListCount - 1
- MSysInfo1.Drive = Drive1.List(l)
- aStr(l).Name = Left$(MSysInfo1.Drive, 2)
- aStr(l).Total = Format$(Format$(MSysInfo1.TotalDiskSpace, "###,###,###,##0"), "@@@@@@@@@@@@@@@") & " Bytes"
- aStr(l).Available = Format$(Format$(MSysInfo1.AvailableDiskSpace, "###,###,###,##0"), "@@@@@@@@@@@@@@@") & " Bytes"
- Select Case MSysInfo1.DriveType
- Case sysFIXED
- aStr(l).Type = "Fixed"
- Case sysNETWORK
- aStr(l).Type = "Network"
- Case sysCDROM
- aStr(l).Type = "CD-ROM"
- Case sysREMOVABLE
- aStr(l).Type = "Removable"
- Case sysRAMDISK
- aStr(l).Type = "RAM Disk"
- Case Else
- aStr(l).Type = "Unavailable"
- End Select
-
- If Len(aStr(l).Total) > iTotalLen Then
- iTotalLen = Len(aStr(l).Total)
- End If
-
- If Len(aStr(l).Available) > iAvailableLen Then
- iAvailableLen = Len(aStr(l).Available)
- End If
- Next l
- '
- 'this code just formats the results so
- 'it will be easy to print later
- Text1(2).Text = ""
- strHeader = "Drive" & vbTab
- mystr = Space$(iTotalLen)
- Mid$(mystr, 1, 15) = Format$("Total Space", "@@@@@@@@@@@@@@@")
- strHeader = strHeader & mystr & vbTab
- mystr = Space$(iAvailableLen)
- Mid$(mystr, 1, 15) = Format$("Free Space", "@@@@@@@@@@@@@@@")
- strHeader = strHeader & mystr & vbTab
- strHeader = strHeader & "Type" & vbCrLf
-
- l = 0
- For l = 0 To UBound(aStr)
- mystr = aStr(l).Name
- Text1(2).Text = Text1(2).Text & mystr & vbTab
- mystr = Space$(iTotalLen)
- Mid$(mystr, 1, Len(aStr(l).Total)) = aStr(l).Total
- Text1(2).Text = Text1(2).Text & mystr & vbTab
- mystr = Space$(iAvailableLen)
- Mid$(mystr, 1, Len(aStr(l).Available)) = aStr(l).Available
- Text1(2).Text = Text1(2).Text & mystr & vbTab
- Text1(2).Text = Text1(2).Text & aStr(l).Type & vbCrLf
- If l = 0 Then
- Text1(2).Text = strHeader & String$(Len(Text1(2).Text) + 11, "=") & vbCrLf & Text1(2).Text
- End If
- Next l
- 'FILES
- 'this code gets the version info of a few pertinent files
- 'we'll get winsock and wsock32, the MFC files
- 'and the RAS Phonebook if NT
- strHeader = Format$("Description:", "@@@@@@@@@@@@@@@@")
- strHeader = strHeader & " Version Date Time "
- strHeader = strHeader & Format$("Size", "@@@@@@@@@@@") & " Location"
- Me.Caption = "Getting File info..."
- Text1(3).Text = strHeader & vbCrLf
- mystr = String$(Len(strHeader) + Len(MSysInfo1.SystemPath) + 6, "=")
- Text1(3).Text = Text1(3).Text & mystr & vbCrLf
- If Dir$(MSysInfo1.WindowsPath & "\winsock.dll") <> "" Then
- MSysInfo1.filename = MSysInfo1.WindowsPath & "\winsock.dll"
- mystr = Format$(MSysInfo1.FileVersion, "!@@@@@@@@@@@@@@@")
- mystr = mystr & Format$(MSysInfo1.FileDate, "mm-dd-yyyy") & " " & Format$(MSysInfo1.FileTime, "Short Time") & " " & Format$(MSysInfo1.FileSize \ 1024, "@@@@@@@") & " KB " & MSysInfo1.filename
- Text1(3).Text = Text1(3).Text & Format$("Winsock: ", "@@@@@@@@@@@@@@@@@") & mystr & vbCrLf
- ElseIf Dir$(MSysInfo1.SystemPath & "\winsock.dll") <> "" Then
- MSysInfo1.filename = MSysInfo1.SystemPath & "\winsock.dll"
- mystr = Format$(MSysInfo1.FileVersion, "!@@@@@@@@@@@@@@@")
- mystr = mystr & Format$(MSysInfo1.FileDate, "mm-dd-yyyy") & " " & Format$(MSysInfo1.FileTime, "Short Time") & " " & Format$(MSysInfo1.FileSize \ 1024, "@@@@@@@") & " KB " & MSysInfo1.filename
- Text1(3).Text = Text1(3).Text & Format$("Winsock: ", "@@@@@@@@@@@@@@@@@") & mystr & vbCrLf
- End If
- If Dir$(MSysInfo1.WindowsPath & "\wsock32.dll") <> "" Then
- MSysInfo1.filename = MSysInfo1.WindowsPath & "\wsock32.dll"
- mystr = Format$(MSysInfo1.FileVersion, "!@@@@@@@@@@@@@@@")
- mystr = mystr & Format$(MSysInfo1.FileDate, "mm-dd-yyyy") & " " & Format$(MSysInfo1.FileTime, "Short Time") & " " & Format$(MSysInfo1.FileSize \ 1024, "@@@@@@@") & " KB " & MSysInfo1.filename
- Text1(3).Text = Text1(3).Text & Format$("32-bit Winsock: ", "@@@@@@@@@@@@@@@@@") & mystr & vbCrLf
- ElseIf Dir$(MSysInfo1.SystemPath & "\winsock.dll") <> "" Then
- MSysInfo1.filename = MSysInfo1.SystemPath & "\wsock32.dll"
- mystr = Format$(MSysInfo1.FileVersion, "!@@@@@@@@@@@@@@@")
- mystr = mystr & Format$(MSysInfo1.FileDate, "mm-dd-yyyy") & " " & Format$(MSysInfo1.FileTime, "Short Time") & " " & Format$(MSysInfo1.FileSize \ 1024, "@@@@@@@") & " KB " & MSysInfo1.filename
- Text1(3).Text = Text1(3).Text & Format$("32-bit Winsock: ", "@@@@@@@@@@@@@@@@@") & mystr & vbCrLf
- End If
- If Dir$(MSysInfo1.SystemPath & "\mfc40.dll") <> "" Then
- MSysInfo1.filename = MSysInfo1.SystemPath & "\mfc40.dll"
- mystr = Format$(MSysInfo1.FileVersion, "!@@@@@@@@@@@@@@@")
- mystr = mystr & Format$(MSysInfo1.FileDate, "mm-dd-yyyy") & " " & Format$(MSysInfo1.FileTime, "Short Time") & " " & Format$(MSysInfo1.FileSize \ 1024, "@@@@@@@") & " KB " & MSysInfo1.filename
- Text1(3).Text = Text1(3).Text & Format$("MFC Library: ", "@@@@@@@@@@@@@@@@@") & mystr & vbCrLf
- End If
- If Dir$(MSysInfo1.SystemPath & "\msvcrt40.dll") <> "" Then
- MSysInfo1.filename = MSysInfo1.SystemPath & "\msvcrt40.dll"
- mystr = Format$(MSysInfo1.FileVersion, "!@@@@@@@@@@@@@@@")
- mystr = mystr & Format$(MSysInfo1.FileDate, "mm-dd-yyyy") & " " & Format$(MSysInfo1.FileTime, "Short Time") & " " & Format$(MSysInfo1.FileSize \ 1024, "@@@@@@@") & " KB " & MSysInfo1.filename
- Text1(3).Text = Text1(3).Text & Format$("MFC Runtime: ", "@@@@@@@@@@@@@@@@@") & mystr & vbCrLf
- End If
- If Dir$(MSysInfo1.SystemPath & "\olepro32.dll") <> "" Then
- MSysInfo1.filename = MSysInfo1.SystemPath & "\olepro32.dll"
- mystr = Format$(MSysInfo1.FileVersion, "!@@@@@@@@@@@@@@@")
- mystr = mystr & Format$(MSysInfo1.FileDate, "mm-dd-yyyy") & " " & Format$(MSysInfo1.FileTime, "Short Time") & " " & Format$(MSysInfo1.FileSize \ 1024, "@@@@@@@") & " KB " & MSysInfo1.filename
- Text1(3).Text = Text1(3).Text & Format$("OLE Property: ", "@@@@@@@@@@@@@@@@@") & mystr & vbCrLf
- End If
- If MSysInfo1.OSPlatform = sysPLATFORM_NT Then
- If Dir$(MSysInfo1.SystemPath & "\rasphone.pbk") <> "" Then
- MSysInfo1.filename = MSysInfo1.SystemPath & "\rasphone.pbk"
- mystr = Space$(15)
- mystr = mystr & Format$(MSysInfo1.FileDate, "mm-dd-yyyy") & " " & Format$(MSysInfo1.FileTime, "Short Time") & " " & Format$(MSysInfo1.FileSize \ 1024, "@@@@@@@") & " KB " & MSysInfo1.filename
- Text1(3).Text = Text1(3).Text & Format$("Winsock: ", "@@@@@@@@@@@@@@@@@") & mystr & vbCrLf
- ElseIf Dir$(MSysInfo1.SystemPath & "\ras\rasphone.pbk") <> "" Then
- MSysInfo1.filename = MSysInfo1.SystemPath & "\ras\rasphone.pbk"
- mystr = Space$(15)
- mystr = mystr & Format$(MSysInfo1.FileDate, "mm-dd-yyyy") & " " & Format$(MSysInfo1.FileTime, "Short Time") & " " & Format$(MSysInfo1.FileSize \ 1024, "@@@@@@@") & " KB " & MSysInfo1.filename
- Text1(3).Text = Text1(3).Text & Format$("RAS Phonebook: ", "@@@@@@@@@@@@@@@@@") & mystr & vbCrLf
- End If
- End If
- MousePointer = 0
- Me.Caption = lpTemp
- cmdPrint.Enabled = True
- End Sub
-